<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户home</title>
    <!--    <script src="../js/vue.js" type="module"></script>-->
    <!--    <script type="text/javascript" src="../jQuery.js"></script>-->
    <!--    <script src="../js/axios.min.js" type="module"></script>-->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.10/vue.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.1/axios.min.js"></script>
</head>
<body>
<h1>欢迎来到home页面</h1>
<div id="vue-list-one" style="border:1px ;border-color: red ;width: 100%;height: 150px">
    <div v-for="(item,index) in content">
        {{item.name}}
    </div>
    <p>{{content}}</p>

    </tr> -->
</div>
</body>
<script>
    var vmm = new Vue({
        el: "#vue-list-one",
        created: function () {
            this.cr();//需要触发的函数
        },
        data:{
            content:[]
        },
        methods: {
            cr() {
                axios.defaults.withCredentials = true;
                var self = this;
                axios.post("http://localhost:8080/load/homeload",{
                    params:{
                        crossDomain: true,
                        xhrFields: {withCredentials: true},
                    }
                }).then(function (res) {
                    console.log(res);
                    self.content=res.data;
                    // res.data.forEach(item=>console.log(item));
                    // self.content = JSON.stringify(res.data)
                    // console.log("======"+ self.content );
                });

            }
        }


    });
</script>


</html>